//
//  YHYBaseViewController.m
//  Relax
//
//  Created by yanghuiyan on 16/4/18.
//  Copyright © 2016年 yanghuiyan. All rights reserved.
//

#import "YHYBaseViewController.h"
#import "PlayViewController.h"
@interface YHYBaseViewController ()

@end

@implementation YHYBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor colorWithRed:248/255.0 green:245/255.0 blue:245/255.0 alpha:1];
//    self.edgesForExtendedLayout=UIRectEdgeNone;
    self.navigationController.navigationBar.translucent = NO;
    
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:245/255.0 green:245/255.0 blue:245/255.0 alpha:1];
    
    self.navigationController.navigationBar.tintColor = [UIColor lightGrayColor];
    
    //导航栏左侧按钮
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"音乐图标"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ] style:UIBarButtonItemStylePlain target:self action:@selector(rightItemAction:)];
    self.navigationItem.rightBarButtonItem = rightItem;
    [rightItem release];
    
//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
//    
//    NSString *states = [[NSUserDefaults standardUserDefaults] objectForKey:@"night"];
//    
//    if ([states isEqualToString:@"YES"]) {
//        //黑夜状态
//        self.view.backgroundColor =  [UIColor colorWithRed:100/255.0 green:106/255.0 blue:107/255.0 alpha:1.0];
//    }
}

//    self.automaticallyAdjustsScrollViewInsets = NO;

- (void)rightItemAction:(UIBarButtonItem *)sender {
    
    PlayViewController *VC = [PlayViewController SharePlayViewController];
    [self presentViewController:VC animated:YES completion:^{
        
    }];
    
}

//- (void)changeColor:(NSNotification*)sender {
//    UIColor *color = [sender object];
//    
//    self.view.backgroundColor = color;
//}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
